package com.example.webchar.webchar.mapper.master;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.webchar.webchar.pojo.Users;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @program: webchars
 * @description
 * @author: YouName
 * @create: 2021-06-24 14:05
 **/
@Mapper
@Service
public interface UserMapperMaster extends BaseMapper<Users> {
    /**
     * 根据user信息插入novel表
     *
     * @param user
     */
    @Insert("insert into users (name,password,email) value(#{user.name},#{user.password},#{user.email})")
    @Options(useGeneratedKeys = true, keyProperty = "user.id")
    void insUsers(@Param("user") Users user);

    /**
     * 为连接表中插入信息
     *
     * @param userId
     * @param roseId
     */
    @Insert("insert into rose_users(user_id,rose_id) value(#{userId},#{roseId}) ")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insRoseUser(@Param("userId") Integer userId, @Param("roseId") String roseId);

}
